package make.free.app.mcaro.activity;

import make.free.app.mcaro.R;
import make.free.app.mcaro.Dialog.Dialog_Choice_AI;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * 
 * @author NamPhong
 *
 */

public class MainGame extends Activity implements OnClickListener {
	private Button btn2Player, btn1Player, btnHelp, btnFacebook;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		btn2Player = (Button) findViewById(R.id.main_btn_twoplayer);
		btn1Player = (Button) findViewById(R.id.main_btn_oneplayer);
		btnHelp = (Button) findViewById(R.id.main_btn_help);
		btnFacebook = (Button) findViewById(R.id.main_btn_fb);
		
		btn2Player.setOnClickListener(this);
		btn1Player.setOnClickListener(this);
		btnFacebook.setOnClickListener(this);
		btnHelp.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.main_btn_twoplayer:
			Intent i = new Intent(getApplicationContext(),Game.class);
			i.putExtra("gametype", 1);
			startActivity(i);

			break;
		case R.id.main_btn_oneplayer:
			Dialog_Choice_AI ai = new Dialog_Choice_AI(this);
			ai.show();
			break;
		case R.id.main_btn_help:
			Intent i1 = new Intent(getApplicationContext(),HelpActivity.class);
			startActivity(i1);
			break;
		case R.id.main_btn_fb:
			Intent j = new Intent(getApplicationContext(),FacebookActivity.class);
			startActivity(j);
			break;
		default:
			break;
		}

	}
}
